/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hvkdbmc.setting;

import java.util.Date;

/**
 *
 * @author LuckyMan
 */
public class HVKLogManager {

    public static void WriteError(String  mess, String FromClass, String FromMethod) {
        String Er = "\n+An error occurs  at:" + new Date().toString()
                + " From class:" + FromClass + " in method:" + FromMethod + "";
        Er += "\n|---->Details:" + mess;
        HVKBaseUtils.AppendStringToFile(HVKSetting.fileLoggerError, Er);
    }
    
    
    
    public static void ClearErrorLogging() {
        try {
            HVKBaseUtils.WriteToFile(HVKSetting.fileLoggerError, "");
        } catch (Exception ex) {
        }
    }

    public static String ViewErrorLogging() {
        try {
            return HVKBaseUtils.GetFileContent(HVKSetting.fileLoggerError);
        } catch (Exception ex) {
        }
        return "Error while get file log content";
    }
    
    public static void WriteLogAcction(String  mess) {
        String logg = "\n\n" + new Date().toString() +" :: "+mess;
        HVKBaseUtils.AppendStringToFile(HVKSetting.fileLoggerAction, mess);
    }

    public static void ClearActionLogging() {
        try {
            HVKBaseUtils.WriteToFile(HVKSetting.fileLoggerAction, "");
        } catch (Exception ex) {
        }
    }

    public static String ViewActionLogging() {
        try {
            return HVKBaseUtils.GetFileContent(HVKSetting.fileLoggerAction);
        } catch (Exception ex) {
        }
        return "Error while get file log content";
    }
}
